﻿using System;
using System.Collections.Generic;

namespace Lhz.Framework.Test.Entity
{
    public static class EntityFactory
    {
        public static int studentId = 0;

        public static Student BuildStudent(Teacher headteacher)
        {
            var id = studentId++;
            return new Student()
            {
                Guid = Guid.NewGuid(),
                Name = "AtName" + id,
                Books = new List<Book>(),
                Headteacher = headteacher,
                HeadteacherGuid = headteacher.Guid,
                Teachers = new List<Teacher>()
            };
        }

        public static int bookId = 0;

        public static Book BuildBook(Student student)
        {
            var id = bookId++;
            return new Book()
            {
                Guid = Guid.NewGuid(),
                Name = "AtName" + id,
                StudentGuid = student.Guid
            };
        }

        public static int teacherId = 0;

        public static Teacher BuildTeacher()
        {
            var id = teacherId++;
            return new Teacher()
            {
                Guid = Guid.NewGuid(),
                Name = "AtName" + id
            };
        }
    }
}
